﻿/* Pomoho UI - Searched */
/* Created By SMbey0nd 2009-2-17 */

Pui.Searched = {
	init:function(){
		this.tagCloud();
	},
	tagCloud:function(id,e){ //ID, 权值数组
		var len = $(id+' li').length;
		for(i=0;i<len;i++){
			var obj = $(id+' li').get(i);
			$(obj).addClass('level-' + e[i]);
		}
	},
	searchover:function(){
		//搜索结果页的相关选项
		var addrurl=window.location.toString().toLocaleLowerCase();
		//addrurl="http://search.pomoho.com/usersearch.aspx?_keyword=gfg&gf=2".toLocaleLowerCase();
		if (/_keyword=/.test(addrurl)) {
			var searchVal = decodeURIComponent(addrurl.split("_keyword=")[1].split("&")[0]);
			$("#SearchInput").val(searchVal);
		}	
		var addrs=[/videosearch/,/usersearch/,/subjectsearch/];
	    var addrs1=[/searchvideo/,/searchuser/,/searchsubject/];
		for(var i=1;i<=addrs.length;i++){
			if (addrs[i-1].test(addrurl)||addrs1[i-1].test(addrurl)) {
				$("#Selected").text($("#SelDiag" + i+ "").text());
				break;
				}
		}

	}
};
